// import axios from "axios";
import http from "@/utils/http";

export default {
  namespaced: true,

  state: {
    agentList: [],
    offlineList: []
  },

  mutations: {
    SETAGENTLIST(state, list) {
      state.agentList = list;
    },
    SETOFFLINELIST(state, list) {
      state.offlineList = list;
    }
  },

  actions: {
    getAgentList({ commit }) {
      http
        .post(
          "/api/login/agent/get_select?token=2Q3ntNqyo5eaLmXITABb"
        )
        .then(response => {
          // console.log(response);
          let res = response.data.list;
          commit("SETAGENTLIST", res);
        });
    },
    // getOfflineList({ commit }, id) {
    //   http
    //     .post(
    //       `/api/login/sub_agent/get_select?account_id=${id}&token=2Q3ntNqyo5eaLmXITABb`
    //     )
    //     .then(response => {
    //       // console.log(response);
    //       let res = response.data.list;
    //       commit("SETOFFLINELIST", res);
    //     });
    // }
  }
};
